﻿using System.Windows.Controls;
using Cirrious.MvvmCross.Interfaces.ViewModels;
using Cirrious.MvvmCross.WindowsPhone.Views;
using TeaLightV5.Foundation.UX.ViewModels;

namespace TeaLightV5.Foundation.Ux.WinPhone.Views
{
    public class EntityPart<T> : UserControl
        where T : class, IMvxViewModel
    {
        private T _viewModel;
        public T PartViewModel
        {
            get { return _viewModel; }
            set
            {
                if (_viewModel == value)
                    return;

                _viewModel = value;
                DataContext = PartViewModel;
            }
        }

    }
}
